//
// Created by lymk on 2021/8/3.
//

#ifndef GAME2D_SUBSYSTEM1_H
#define GAME2D_SUBSYSTEM1_H
#include "WindowsHandler.h"
#include "string"
#include "Utils.h"
#include "GameActor.h"

class SubSystem1 : public WindowsHandler{
    HDC tmpDC;
    HDC bufDC;
    PicData backgroundData;
    PhyComponent* worldPhy;
    GameActor* actor;

    int MAX_ITEM_NUM;
    std::vector<ItemActor*> item;
    CoolUtil* spawnItemCD;
public:
    SubSystem1();
    virtual void Render() override;
    virtual void Tick(double DeltaSeconds) override;
    virtual int Initialize() override;
    virtual void Finalize() override;
    virtual void HandleKeyInput(u_short keyID,KEY_ACTION Action) override;
    virtual void HandleMouseInput(u_short keyID,int x,int y,KEY_ACTION Action) override;
    void HandleInput();

    bool play = false;
    bool bPause = true;
    bool bHasWin = false;
    bool bGameOver = false;

    void RenderPNG(PicData pic,int posx,int poxy);
    void DrawPicture(std::string path,int posx,int poxy);
    void PlayASound(std::string path);
    void SpawnItem();
    void DrawScore();
    void HandleMesWindows();
    bool GameOver() const{return bGameOver;}

};


#endif //GAME2D_SUBSYSTEM1_H
